package com.estun.backroundManagementService.modules.product.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 产品过站记录表
 * </p>
 *
 * @author machine
 * @since 2023-02-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("product_station_time")
@ApiModel(value = "ProductStationTime对象", description = "产品过站记录表")
public class ProductStationTime implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "产品编号")
    private Long productId;

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "所属工位")
    private String stationId;

    @ApiModelProperty(value = "进站时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "出站时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "用时(秒)")
    private Integer diffSecond;

    @ApiModelProperty(value = "结果 0->异常 1->正常 -1-无结果")
    private Integer status;

    @ApiModelProperty(value = "图像路径")
    private String imagePath;

    /**
     * 工厂mes推送状态 0 待推送 1已推送 -1失败
     */
    private Integer submitStatus;

    /**
     * 已推送次数
     */
    private Integer submitNumber;


}
